package com.yunhe.common.model.base;

public enum WeatherType {

    CLEAR("clear","晴"),
    FOG("fog","雾"),
    RAIN("rain","雨"),
    CLOUD("cloud","云"),
    SNOW("snow","雪");


    private String chinese;
    private String english;

    public String getChinese() {
        return chinese;
    }

    public void setChinese(String chinese) {
        this.chinese = chinese;
    }

    public String getEnglish() {
        return english;
    }

    public void setEnglish(String english) {
        this.english = english;
    }

    private WeatherType(String english, String chinese){
        this.chinese = chinese;
        this.english = english;
    }

    public static WeatherType getEnglishByChinese(String chinese) {
        WeatherType defaultType = WeatherType.CLOUD;
        for (WeatherType wtype : WeatherType.values()) {
            if (wtype.chinese == chinese) {
                return wtype;
            }
        }
        return defaultType;
    }

}
